#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
    int fd = open("/dev/pts/1", O_WRONLY|O_APPEND);
    if(fd < 0) return 1;

    const char *message = "hahaha\n";
    while(1)
    {
        write(fd, message, strlen(message));
        sleep(1);
    }

    close(fd);
}
